package guoanmaker.provider.business.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

import guoanmaker.provider.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
 * 
* @ClassName: PersonalUser 
* @Description: C端用户表
* @author Yvonne_MGL
* @date 2017年7月6日 下午3:21:41 
*  
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_personal_user")
public class PersonalUser extends IdEntity{
	
	private String username;//用户名(手机号)
	private Date createTime;//注册时间
	private String nickname;//昵称
	private String birthday;//生日
	private String name;//名字
	private String email;//邮箱
	private String remark;//备注
	private String isProvider;//是否成为了服务商,0为未申请,1为已申请,2为已成为
	private Date lastLandTime;//最后一次登录时间
	private String portrait;//头像存储地址
	public PersonalUser(String username, Date createTime, String nickname, String birthday, String name, String email, String remark,
						String isProvider, Date lastLandTime, Set<ProvideOrderForm> orderforms, Set<ProvideSpaceReserve> spacereserves,
						Set<PersonalUserCoupon> puCoupons) {
		this.username = username;
		this.createTime = createTime;
		this.nickname = nickname;
		this.birthday = birthday;
		this.name = name;
		this.email = email;
		this.remark = remark;
		this.isProvider = isProvider;
		this.lastLandTime = lastLandTime;
		this.orderforms = orderforms;
		this.spacereserves = spacereserves;
		this.puCoupons = puCoupons;
	}

	/*
        private String portrait;//头像存储地址
        private String portraitName;//头像名称
        private String weibouuid;//微博uuid
        private String wechatopenid;//微信openid
        private String qqopenid;//qq openid
        private String wechatnickname;//微信昵称
        private String qqnickname;//qq昵称
        private String weibonickname;//微博昵称
        private String wechatportrait;//微信头像存储地址
        private String qqportrait;//qq头像存储地址
        private String weiboportrait;//微博头像存储地址
        private String wechatportraitN;//微信头像名称
        private String qqportraitN;//qq头像名称
        private String weiboportraitN;//微博头像名称
        private String thirdtype;//登录类型
        private String wechat;//微信账号
        private String qq;//qq账号
        private String weibo;//微博账号
        private String jpushid;//推送id
        private String jpushAlias;//推送别名
        */
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	//@JSONField(serialize=false)
    private Set<ProvideOrderForm> orderforms;
	
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	//@JSONField(serialize=false)
    private Set<ProvideSpaceReserve> spacereserves;
	
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	@JSONField(serialize=false)
	private Set<PersonalUserCoupon> puCoupons;
	
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	//@JSONField(serialize=false)
    private Set<ProvideDemandDocking> demanddsocking;

}
